package d2_final_exam.d1_first_question;

import java.time.LocalDateTime;


public class Order {

    //1、对照order.xml定义相应的属性-->体现封装性
    private int id;//编号
    private String name;//名称
    private LocalDateTime localDateTime;//生成时间
    private double price;//价格

    //2、提供相应的get与set方法

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDateTime getLocalDateTime() {
        return localDateTime;
    }

    public void setLocalDateTime(LocalDateTime localDateTime) {
        this.localDateTime = localDateTime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    //3、在提供一个toString()方法

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", localDateTime=" + localDateTime +
                ", price=" + price +
                '}';
    }
}
